Calc the number occurrence of character in a stringΒΆ
Count the number occurrence of a specific character in a string.
s = 'The quick brown fox jumps over the lazy dog.'
print(s.count('q'))
Output:
1
s = 'The quick brown fox jumps over the lazy dog.'
print(s.count('q'))
Output:
1